<?php


namespace Xiaoguai\DesignPattern\DP008;


class Invoker
{
    protected $command;

    public function __construct(CommandInterface $command)
    {
        $this->command = $command;
    }

    public function setCommand(CommandInterface $command)
    {
        $this->command = $command;
    }

    public function call()
    {
        return $this->command->execute();
    }
}